package thread.pool;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

public class CustomRejectedExecutionHandler implements RejectedExecutionHandler {
    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        // 处理被拒绝的任务，例如记录日志、抛出异常等
        System.out.println("任务被拒绝：" + r.toString());
    }
}
